package com.book.book.mapper;

import com.book.book.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; // 确保有这一行

/**
 * @author admin
 * @description 针对表【user】的数据库操作Mapper
 * @createDate 2025-06-07 16:08:20
 * @Entity generator.domain.User
 */
@Mapper
public interface UserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(User record); // 这个方法名与 insertSelective 有点重复，建议只用一个

    int insertSelective(User record);

    User selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    User selectByUsernameAndPassword(@Param("username") String username, @Param("userpassword") String userpassword);

    // 新增方法：根据用户名查询用户（用于检查用户名是否已存在）
    User selectByUsername(@Param("username") String username);
}